﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<%var modelatt = v.data("modelatt") as List<Model_Att>; %>
<%var typeread = v.data("typeread") as TypeList; %>
<%var read = v.data("read") as System.Data.DataRow; %>
<%var readview = v.data("readview") as Document; %>
<%var modelview = v.data("modelview") as Model; %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="/static/public/tinyMCE/jquery.tinymce.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/dialog.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/colorpicker.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/initedit.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/My97DatePicker/WdatePicker.js?v=#{jsVersion}"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var article_js_noselect_empty  = "_{article_js_noselect_empty}";
	var article_js_input_err  = "_{article_js_input_err}";
	var article_doc_add_tid  = "_{article_doc_add_tid}";
	var article_js_link_empty  = "_{article_js_link_empty}";
	var article_js_template_empty  = "_{article_js_template_empty}";
	var article_js_filename_empty  = "_{article_js_template_empty}";
	var article_js_doc_edit_ok = "_{article_js_doc_edit_ok}";
	var article_js_doc_edit_no = "_{article_js_doc_edit_no}";
	var article_js_doc_copy_ok = "_{article_js_doc_copy_ok}";
	var article_js_doc_copy_no = "_{article_js_doc_copy_no}";
	var refalse = "#{refalse}";
	var imagestitle="_{filemanage_select_title}";
	var addbottonname="_{selectfile_botton}";
	var remimages="_{remimages_botton}";
	var adminurl = "#{adminurl}";
	var mid = "#{mid}";
	var iframename = "#{iframename}";
	var addtype = "#{type}";

	$(document).ready(function(){
		editshow("#content");
	    <%foreach(var row in modelatt){%>
        <%if (row.inputtype == "editor" && row.attrname != "content") {%>
	    editsimpleshow("#<%=row.attrname%>");
	    <%}%>
		<%}%>

		$('#color').EasySiteColorSelect();
		var h = '#{iframeheightwindow}';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: false
		};
		$('#docadd').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		parent.scrolclear();
	})




	function formverify(formData, jqForm, options) {
		for (var i=0; i< formData.length; i++){
		    <%foreach(var row in modelatt){%>
            <%if(row.inputtype =="editor"){%>
		         if (formData[i].name == "<%=row.attrname%>"){
		             formData[i].value=tinyMCE.get('<%=row.attrname%>').getContent();
		         }
		    <%}%>
		    <%}%>
		}
		var queryString = $.param(formData);
		var get=urlarray(queryString);

	    <%foreach(var row in modelatt){%>
	    <%if(row.isvalidate ==1){%>
            <%if(row.validatetext !=""){%>
	           if(get['<%=row.attrname%>'].match(<%=row.validatetext%>ig)==null) {
	        <%}else{%>
	        if(get['<%=row.attrname%>']==''){
	            <%}%>
	            document.docadd.<%=row.attrname%>.focus();
	            alert('<%=row.typename%>'+article_js_input_err);
	            return false;
	        }
	        <%}%>
		<%}%>

		if(get['islink']==1){
			if(get['link'].match(/^http:\/\/[a-zA-Z\:.0-9-%@#;&?=/_]+$/ig)==null) {
				document.docadd.link.focus();
				alert(article_js_link_empty);
				return false;
			}
		}

		if(get['tid']==0){
			document.docadd.tid.focus();
			alert(article_doc_add_tid+article_js_noselect_empty);
			return false;
		}
        <%if(typeread.styleid !=4){%>
		if(get['istemplates']==1){
			if(get['template'].match(/^[\w-]+$/ig)==null) {
				document.docadd.template.focus();
				alert(article_js_template_empty);
				return false;
			}
		}
		if(get['filename']!=''){
			if(get['filename'].match(/^[\w-//]+$/ig)==null) {
				document.docadd.filename.focus();
				alert(article_js_filename_empty);
				return false;
			}
		}
		<%}%>
		parent.windowsdig('Loading','iframe:#{load}','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			if(parent.frames[iframename].document.getElementById("selectform")){
				parent.frames[iframename].refresh('selectform','selectall','check_all');
			}
			if (addtype=='edit'){
				alert(article_js_doc_edit_ok);
			}else{
				alert(article_js_doc_copy_ok);
			}

		}else{
			if (addtype=='edit'){
				alert(article_js_doc_edit_no+'Return message:'+options);
			}else{
				alert(article_js_doc_copy_no+'Return message:'+options);
			}

		}
		parent.scrolopen();
		parent.onaletdoc();
	}

</script>
</head>

<body>
<%var type = v.data("type") as String; %>
<form name="docadd" id="docadd" method="post" action="#{ActionLink}">
<input type="hidden" name="inputclass" value="#{type}" />
<input type="hidden" name="tab" id="docaddtab" value="#{tab}" />
<input type="hidden" name="mid" id="mid" value="#{mid}" />
<input type="hidden" name="lng" id="lng" value="#{lng}" />
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2"><%if(type =="edit"){ %>_{article_doc_edit_title}<%}else{ %>_{article_doc_copy_title}<%} %></span> <span class="colorgorningage">（#{readview.title}#{modelview.modelname}）</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
                    <%if(modelview.istsn ==1 && typeread.styleid <=2){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_tsn}</td>
						<td class="trtitle02">
							<input type="text" name="tsn" size="25" maxlength="20" value="#{readview.tsn}" id="tsn" class="infoInput"/>
							<span class="cautiontitle" id="dirnameerr">_{article_doc_add_tsn_mess}</span>
						</td>
					</tr>
					<%} %>
					<%foreach(var row in modelatt){%>
						<tr class="trstyle2">
							<td class="trtitle01"><%=row.typename %></td>
							<td class="trtitle02">
								<%if (row.inputtype == "string" || row.inputtype == "int" || row.inputtype == "float" || row.inputtype == "decimal") { %>
								<input type="text" name="<%=row.attrname %>" size="<%=row.attrsize %>" id="<%=row.attrname %>" value="<%=read[row.attrname] %>" maxlength="<%=row.attrlenther %>" class="infoInput"/>
								<%} else if (row.inputtype == "text" || row.inputtype == "editor") { %>
								<textarea name="<%=row.attrname %>" id="<%=row.attrname %>"  style="width:99%;height:<%=row.attrrow %>px;" class="infoInput"><%=read[row.attrname] %></textarea>
                                <%} else if (row.inputtype == "htmltext") { %>
								<textarea name="<%=row.attrname %>" id="<%=row.attrname %>"  style="width:99%;height:<%=row.attrrow %>px;" class="infoInput"><%=StringHelper.HTMLToText(read[row.attrname].ToString()) %></textarea>
								<%} else if (row.inputtype == "img") { %>
								<ul class="addpiclist">
                                    <%if(!read[row.attrname].IsNull()){ %>
									<li id="addsrli<%=row.attrname %>"><a title="_{remimages_botton}" ondblclick="removerpic('addsrli<%=row.attrname %>','<%=row.attrname %>')" href="#body"><p><img id="addsr<%=row.attrname %>" width="100" height="100" src="#{adminurl}<%=read[row.attrname] %>"></p></a></li>
									<%}else{ %>
									<li id="addsrli<%=row.attrname %>"><a title="_{selectfile_botton}" onclick="javascript:parent.windowsdig('_{filemanage_select_title}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.PublicController().FileWindow) %>?action=filewindow&listfunction=filelist&filetype=img&checkfrom=picshow&getbyid=addsrli<%=row.attrname %>&fileinputid=<%=row.attrname %>&maxselect=1&iframename='+self.frameElement.getAttribute('name'),'900px','480px','iframe')" href="#body"><p><img id="addsr<%=row.attrname %>" width="100" height="100" src="#{path.img}ybb/images/pic.png"></p></a></li>
									<%} %>
								</ul>
								<input type="hidden" name="<%=row.attrname %>" value="<%=read[row.attrname] %>" id="<%=row.attrname %>"/>
								<%} else if (row.inputtype == "selectinput") { %>
								<input type="text" name="<%=row.attrname %>" size="<%=row.attrsize %>" id="<%=row.attrname %>" value="<%=read[row.attrname] %>" maxlength="<%=row.attrlenther %>" class="infoInput"/>
								<select size="1" name="<%=row.attrname %>selectinputvalue" onchange="javascript:$('#<%=row.attrname %>').val(this.value)">
									<option value="">_{botton_select_name}<%=row.typename %></option>
									<%var strArray = row.attrvalue.SplitStringh(); %>
									<%foreach (var row1 in strArray){ %>
									<option value="<%=row1 %>"><%=row1 %></option>
									<%} %>
								</select>
								<%} else if (row.inputtype == "addon") { %>
								<input type="text" name="<%=row.attrname %>" size="<%=row.attrsize %>" id="<%=row.attrname %>" value="<%=read[row.attrname] %>" maxlength="<%=row.attrlenther %>" class="infoInput"/>
								<a class="filecheck" onclick="javascript:parent.windowsdig('_{filemanage_select_title}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.PublicController().FileWindow) %>?listfunction=filelist&filetype=file&checkfrom=input&getbyid=&fileinputid=<%=row.attrname %>&maxselect=1&iframename='+self.frameElement.getAttribute('name'),'900px','480px','iframe')" href="#body">_{selectfile_botton}</a>
								<%} else if (row.inputtype == "video") { %>
								<input type="text" name="<%=row.attrname %>" size="<%=row.attrsize %>" id="<%=row.attrname %>" value="<%=read[row.attrname] %>" maxlength="<%=row.attrlenther %>" class="infoInput"/>
								<a class="movercheck" onclick="javascript:parent.windowsdig('_{filemanage_select_title}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.PublicController().FileWindow) %>?listfunction=filelist&filetype=mover&checkfrom=input&getbyid=&fileinputid=<%=row.attrname %>&maxselect=1&iframename='+self.frameElement.getAttribute('name'),'900px','480px','iframe')" href="#body">_{selectfile_botton}</a>
								<%} else if (row.inputtype == "datetime") { %>
								<input type="text" name="<%=row.attrname %>" size="<%=row.attrsize %>" id="<%=row.attrname %>" value="<%=read[row.attrname] %>" maxlength="<%=row.attrlenther %>" class="infoInput"/>
								<a class="datetime" onclick="WdatePicker({el:'<%=row.attrname %>',readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" href="#body">_{selectdata_botton}</a>
								<%} else if (row.inputtype == "select") { %>
								<select size="1" name="<%=row.attrname %>" id="<%=row.attrname %>">
									<option value="">_{botton_select_name}<%=row.typename %></option>
									<%var strArray = row.attrvalue.SplitStringh(); %>
                                    <%foreach (var row1 in strArray){ %>
									<option <%if(row1 == read[row.attrname].ToString()){ %>selected<%} %> value="<%=row1 %>"><%=row1 %></option>
									<%} %>
								</select>
								<%} else if (row.inputtype == "radio") { %>
									<%var strArray = row.attrvalue.SplitStringh(); %>
									<%foreach (var row1 in strArray){ %>
									<input type="radio" value="<%=row1 %>" name="<%=row.attrname %>" <%if(row1 == read[row.attrname].ToString()){ %>checked="checked"<%} %>/> <%=row1 %>&nbsp;
									<%} %>
								<%} else if (row.inputtype == "checkbox") { %>
									<%var strArray = row.attrvalue.SplitStringh(); %>
									<%foreach (var row1 in strArray){ %>
									<input type="checkbox" value="<%=row1 %>" name="<%=row.attrname %>[]" <%if(row1 == read[row.attrname].ToString()){ %>checked="checked"<%} %>/> <%=row1 %>&nbsp;
									<%} %>
								<%} %>
								<%if (row.attrname == "title") { %><input id="color" name="color" value="<%if(readview.color==""){ %>#000000<%}else{ %><%=readview.color %><%} %>"/><%} %>
								<%if(row.typeremark !=""){ %><span class="cautiontitle"><%=row.typeremark %></span><%} %>
							</td>
						</tr>
                        <%if(row.attrname=="content"){ %>
						<tr class="trstyle2">
							<td class="trtitle01"></td>
							<td class="trtitle02 colorgblue">
                                <%var input_isdellink = Convert.ToInt32(v.data("input_isdellink")); %>
								<input type="checkbox" value="1" name="input_isdellink" <%if(input_isdellink ==1){ %>checked="checked"<%} %> /> _{article_doc_add_content_b1}&nbsp;
								<input type="checkbox" value="1" name="donwloadpic"/> _{article_doc_add_content_b2}&nbsp;
							</td>
						</tr>
						<%} %>
					<%} %>

					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">_{article_doc_tab_title01}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02">
							<a class="keyselect" href="#body" onclick="javascript:parent.windowsdig('_{selecttag_botton}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.SEOController().SEOSelect) %>?inputtext=tags&listfunction=key&checkfrom=input&mid=#{mid}&tid='+document.docadd.tid.value+'&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">_{selecttag_botton}</a>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_tags}</td>
						<td class="trtitle02">
							<input type="text" name="tags" id="tags" maxlength="100" value="#{readview.tags}" class="infoInput" style="width:98%;"/>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02"><span class="cautiontitle">_{article_doc_add_tags_mess}</span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_headtitle}</td>
						<td class="trtitle02"><input type="text" name="headtitle" id="headtitle" value="#{readview.headtitle}" maxlength="100" class="infoInput" style="width:98%;"/></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02">
							<a class="keyselect" href="#body" onclick="javascript:parent.windowsdig('_{selectkeytype_botton}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.SEOController().SEOSelect) %>?inputtext=keywords&listfunction=keytype&checkfrom=function&maxselect=1&mid=#{mid}&tid='+document.docadd.tid.value+'&iframename='+self.frameElement.getAttribute('name'),'850px','450px','iframe');">_{selectkeytype_botton}</a>
							<a class="keyselect" href="#body" onclick="javascript:parent.windowsdig('_{selectkeyword_botton}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.SEOController().SEOSelect) %>?inputtext=keywords&listfunction=key&checkfrom=input&mid=#{mid}&tid='+document.docadd.tid.value+'&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">_{selectkeyword_botton}</a>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_keywords}</td>
						<td class="trtitle02">
							<input type="text" name="keywords" id="keywords" maxlength="100" value="#{readview.keywords}" class="infoInput" style="width:98%;"/>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_description}</td>
						<td class="trtitle02">
							<textarea name="description" id="description"  style="width:98%;height:50px;" class="smallInput">#{readview.description}</textarea>
						</td>
					</tr>
                <%if(typeread.styleid <=2){ %>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">_{article_doc_tab_title02}</td>
					</tr>
                    <%var doclabel = v.data("labellist") as List<Document_Label>; %>
					<%if(doclabel.Count>0){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_recommend}</td>
						<td class="trtitle02" style="line-height: 200%">
                            <%var i = 0; %>
							<%foreach(var row in doclabel){ %>
                                <%i++; %>
								<input type="checkbox" value="<%=row.Id %>" <%if(StringArray.InArray(row.Id.ToString(),readview.recommend)){ %>checked<%} %> name="recommend[]"/> <%=row.labelname %>&nbsp;
								<%if(i % 5==0){ %><br /><%} %>
							<%} %>
						</td>
					</tr>
					<%} %>
                    <%var typelist = v.data("typelist") as List<TypeList>; %>
                    <%if(modelview.isbase==0){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_tid}</td>
						<td class="trtitle02">
							<select size="1" name="tid" id="tid">
								<option selected="selected" value="0">_{article_doc_add_tid_option}</option>
                                <%foreach(var row in typelist){ %>
								<option <%if(row.Id==readview.tid){ %>selected<%} %> value="<%=row.Id %>"><%if(row.level1 >0){ %>├<%} %><%for(var i=1;i<row.level1;i++){ %>─<%} %> <%=row.typename %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<%} %>
                    <%if(modelview.isextid ==1){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_extid}</td>
						<td class="trtitle02">
							<select size="3" name="extid[]" id="extid" multiple="multiple">
								<optgroup label="_{article_doc_add_extid_option}">
								<%foreach(var row in typelist){ %>
								<option <%if(StringArray.InArray(row.Id.ToString(),readview.extid)){ %>selected<%} %> value="<%=row.Id %>"><%if(row.level1 >0){ %>├<%} %><%for(var i=1;i<row.level1;i++){ %>─<%} %> <%=row.typename %></option>
								<%} %>
								</optgroup>
							</select>
						</td>
					</tr>
					<%} %>
                    <%if(modelview.issid ==1){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_sid}</td>
						<td class="trtitle02">
							<select size="1" name="sid" id="sid">
								<option selected="selected" value="0">_{article_doc_add_sid_option}</option>
                                <%var subjectlistarray = v.data("subjectlistarray") as List<SubjectList>; %>
								<%foreach(var row in subjectlistarray){ %>
								<option <%if(row.Id ==readview.sid){ %>selected<%} %>  value="<%=row.Id %>"><%=row.subjectname %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<%} %>
				<%} %>
                    <%if(modelview.isfgid ==1){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_fgid}</td>
						<td class="trtitle02">
							<select size="1" name="fgid" id="fgid">
								<option selected="selected" value="0">_{article_doc_add_fgid_option}</option>
                                <%var formarray = v.data("formarray") as List<Form_Group>; %>
								<%foreach(var row in formarray){ %>
								<option <%if(row.Id==readview.fgid){ %> <%} %> value="<%=row.Id %>"><%=row.formgroupname %></option>
								<%} %>
							</select>
							<span class="cautiontitle" id="dirnameerr">_{article_doc_add_fgid_mess}</span>
						</td>
					</tr>
					<%} %>
                <%if(typeread.styleid <=2){ %>
                    <%if(modelview.ispurview ==1){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_purview}</td>
						<td class="trtitle02">
							<select size="1" name="purview" id="purview">
								<option selected="selected" value="0">_{article_doc_add_purview_option}</option>
                                <%var memberpuvlist = v.data("memberpuvlist") as List<Member_Class>; %>
								<%foreach(var row in memberpuvlist){ %>
								<option <%if(row.Id==readview.purview){ %>selected<%} %> value="<%=row.Id %>"><%=row.rankname %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<%} %>
                    <%if(modelview.isbase==0){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_addtime}</td>
						<td class="trtitle02">
							<input type="text" name="addtime" size="20" maxlength="30" id="addtime" value="#{readview.addtime}" class="infoInput"/>
							<a class="datetime" onclick="WdatePicker({el:'addtime',isShowClear:false,readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" href="#body">_{selectdata_botton}</a>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_click}</td>
						<td class="trtitle02">
							<input type="text" name="click" size="5" maxlength="5" value="#{readview.click}" id="click" class="infoInput"/>
							<span class="cautiontitle">_{article_doc_add_click_mess}</span>
						</td>
					</tr>
					<%} %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_islink}</td>
						<td class="trtitle02">
							<input type="radio" value="1" name="islink" <%if(readview.islink ==1){ %>checked="checked"<%} %> onclick="ondisplay('islinkdiv','trstyle2 displaytrue')" /> _{open_botton_title}&nbsp;
							<input type="radio" value="0" name="islink" <%if(readview.islink ==0){ %>checked="checked"<%} %> onclick="ondisplay('islinkdiv','trstyle2 displaynone')"/> _{close_botton_title}
							<span class="cautiontitle">_{article_doc_add_islink_mess}</span>
						</td>
					</tr>
					<tr class="trstyle2 <%if(readview.islink==1){ %>displaytrue<%}else{ %>displaynone<%} %>" id="islinkdiv">
						<td class="trtitle01">_{article_doc_add_link}</td>
						<td class="trtitle02">
							<input type="text" name="link" size="50" maxlength="230" value="#{readview.link}" class="infoInput"/>
							<span class="cautiontitle">_{article_doc_add_link_mess}</span>
						</td>
					</tr>
				<%} %>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">_{article_doc_tab_title03}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_ishtml}</td>
						<td class="trtitle02">
							<input type="radio" value="1" name="ishtml"<%if(readview.ishtml ==1){ %> checked="checked"<%} %>/> _{article_doc_add_ishtml_1}&nbsp;
							<input type="radio" value="0" name="ishtml"<%if(readview.ishtml ==0){ %> checked="checked"<%} %>/> _{article_doc_add_ishtml_0}
						</td>
					</tr>
                    <%if(modelview.isorder ==1 && typeread.styleid !=3){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_isorder}</td>
						<td class="trtitle02">
							<input type="radio" value="1" name="isorder"<%if(readview.isorder ==1){ %> checked="checked"<%} %>> _{open_botton_title}&nbsp;
							<input type="radio" value="0" name="isorder"<%if(readview.isorder ==0){ %> checked="checked"<%} %>/> _{close_botton_title}
							<span class="cautiontitle">_{article_doc_add_isorder_mess}</span>
						</td>
					</tr>
					<%} %>
                    <%if(typeread.styleid !=4){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_istemplates}</td>
						<td class="trtitle02">
							<input type="radio" value="1" name="istemplates"<%if(readview.istemplates ==1){ %> checked="checked"<%} %>/ onclick="ondisplay('istemplatesdiv','trstyle2 displaytrue')"/> _{open_botton_title}&nbsp;
							<input type="radio" value="0" name="istemplates"<%if(readview.istemplates ==0){ %> checked="checked"<%} %>/ onclick="ondisplay('istemplatesdiv','trstyle2 displaynone')"/> _{close_botton_title}
							<span class="cautiontitle">_{article_doc_add_istemplates_mess}</span>
						</td>
					</tr>
					<tr class="trstyle2 <%if(readview.istemplates !=1){ %>displaynone<%} %>" id="istemplatesdiv">
						<td class="trtitle01">_{article_doc_add_template}</td>
						<td class="trtitle02">
							<input type="text" name="template" id="templatename" size="40" value="#{readview.template}" maxlength="100" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('_{selecttempfile_botton}','iframe:index.php?archive=templatemain&action=listwindow&inputtext=templatename&typeclass=article&skindir=&filedir=article&fileclass=&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'750px','400px','iframe');">_{selecttempfile_botton}</a>
							<span class="cautiontitle">_{article_doc_add_template_mess}</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_filename}</td>
						<td class="trtitle02">
							<input type="text" name="filename" size="40" value="<%if(type =="edit"){ %>#{readview.filename}<%} %>" maxlength="50" class="infoInput"/>
							<span class="cautiontitle">_{article_doc_add_filename_mess}</span>
						</td>
					</tr>
					<%} %>
                    <%if(modelview.ismessage ==1 && typeread.styleid !=3){ %>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_ismessage}</td>
						<td class="trtitle02">
							<input type="radio" value="1" name="ismessage"<%if(readview.ismess ==1){ %> checked="checked"<%} %>/> _{article_doc_add_ismessage_1}&nbsp;
							<input type="radio" value="0" name="ismessage"<%if(readview.ismess ==0){ %> checked="checked"<%} %>/> _{article_doc_add_ismessage_0}
						</td>
					</tr>
					<%} %>
                    <%if(modelview.isalbum ==1 && typeread.styleid !=3){ %>
                    <tr class="trstyle2">
						<td class="trtitle03" colspan="2">_{article_doc_tab_title00}</td>
					</tr>
					<tr class="trstyle3">
						<td class="trtitle01">_{article_doc_add_piclist}</td>
						<td class="trtitle02">
							<a class="picselect" href="#body" onclick="javascript:parent.windowsdig('_{selectpic_botton}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.PublicController().FileWindow) %>?listfunction=filelist&filetype=img&checkfrom=function&getbyid=addpiclist&fileinputid=albumlist&maxselect=20&iframename='+self.frameElement.getAttribute('name'),'900px','480px','iframe')">_{selectpic_botton}</a>
							<span class="cautiontitle">_{selectpic_botton_mess}</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02">
							<ul class="albumlistinput" id="addpiclist">
                                <%var picarray = Document_Album.find(" did =:d order by Id asc").set("d", readview.Id).list(); %>
                                <%var aidlist = String.Empty; %>
								<%foreach(var row in picarray){ %>
								<li ondblclick="$(this).remove();removeval('albumlist','<%=row.picfile %>');">
									<div class="albumpic"><p><img src="<%=strUtil.Join("",row.picfile)  %>" width="100" height="100"></p></div>
									<div class="albuminput">
										<p><input type="text" name="picname[]" value="<%=row.picname %>" style="width:550px;" maxlength="150" class="infoInput"></p>
										<p><textarea name="filedes[]" style="width:550px;height:75px;" class="smallInput"><%=row.filedes %></textarea></p>
									</div>
								</li>
                                <%aidlist += row.picfile + "|"; %>
								<%} %>
							</ul>
							<input type="hidden" name="albumlist" id="albumlist" value="<%=aidlist %>"/>
						</td>
					</tr>
					<%} %>
                    <%if(modelview.islinkdid==1 && typeread.styleid !=3){ %>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">_{article_doc_tab_title04}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_linkdid}</td>
						<td class="trtitle02">
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('_{article_doc_add_linkdid}','iframe:<%=link.to(new wojilu.Web.Controller.Admin.Qycms.ArticleController().Article_Window) %>?checkfrom=function&getbyid=infolinked&inputtext=linkdid&mid=#{mid}&tid=#{tid}&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'800px','400px','iframe');">选择内容</a>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02">
							<ul class="infolinked" id="infolinked">
                                <%var linkdid = readview.linkdid; %>
                                <%if(!linkdid.StrIsNullOrEmpty()){ %>
                                <%foreach(var row in linkdid.SplitInt(",")){ %>
                                <%var md = Document.findById(row); %>
                                <%if(md !=null){ %>
                                <li id="didlinklist<%=md.Id %>"><%=md.title %> <span class="del" onclick="delinfolist('didlinklist<%=md.Id %>','<%=md.Id %>','linkdid')">删除</span></li>
                                <%} %>
                                <%} %><%} %>
							</ul>
							<input type="hidden" name="linkdid" id="linkdid" value="#{readview.linkdid}"/>
						</td>
					</tr>
					<%} %>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
        <%if(type =="edit"){ %>
		<table width="100%">
			<tr>
				<td id="right"><input type="submit" id="docaddsubmitbotton" name="Submit" value="_{botton_edit}" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="_{botton_edit_reset}" class="buttonface" /></td>
			</tr>
		</table>
		<%}else{ %>
		<table width="100%">
			<tr>
				<td id="right"><input type="submit" id="docaddsubmitbotton" name="Submit" value="_{botton_add}" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="_{botton_add_reset}" class="buttonface" /></td>
			</tr>
		</table>
		<%} %>
	</div>
</div>
<input type="hidden" name="datid" id="datid" value="#{datid}" />
<input type="hidden" name="dcid" id="dcid" value="#{dcid}" />
<%if(readview.isbase==1 && typeread.styleid >2){ %>
<input type="hidden" name="addtime" id="addtime" value="#{readview.addtime}" />
<input type="hidden" name="click" id="click" value="#{readview.click}" />
<input type="hidden" name="tid" id="tid" value="#{readview.tid}" />
<input type="hidden" name="isbase" id="isbase" value="#{readview.isbase}" />
<%} %>
</form>
</body>

</html>


